<script>  	
	$(document).ready(function(){
		var projectId = sessvars.sessionObj['projectId']
    	$('select#id_zoneInstance_name').change(function() { 
	    
	    })
	   })
	function submitSurvey(){
		var projectId = sessvars.sessionObj['projectId']
		$.ajax({
			type: "POST",
			url: '/pmp/scsetup/',
			data: JSON.stringify({'select': 'submitSurvey','surveyForm': $('form#surveyForm').serializeObject(), 'projectId':projectId}),
			success: function(data){
				$('#surveyInline').html(data)
				$('#surveysuccess').fadeIn().delay(2000).fadeOut(1000);    
			}
		});
	}
	
</script>

{% load widget_tweaks %}
<form id='surveyForm'>
	{{ survey.management_form }}
	<p>
	<h5>Occupant satisfaction (%)</h5>
	Acoustics: {{survey.survey_acoustics|add_class:"span1"}} &nbsp;&nbsp;
	IAQ: {{survey.survey_iaq|add_class:"span1"}}&nbsp;&nbsp;
	Lighting: {{survey.survey_lighting|add_class:"span1"}}&nbsp;&nbsp;
	Thermal comfort: {{survey.survey_tc|add_class:"span1"}}
	</p>
	<p>
	<h5>Benchmark (percentile) score (%)</h5>
	Acoustics: {{survey.survey_acoustics_bm|add_class:"span1"}} &nbsp;&nbsp;
	IAQ: {{survey.survey_iaq_bm|add_class:"span1"}}&nbsp;&nbsp;
	Lighting: {{survey.survey_lighting_bm|add_class:"span1"}}&nbsp;&nbsp;
	Thermal comfort: {{survey.survey_tc_bm|add_class:"span1"}}
	</p> 
	<p style="margin-top: 5px"><input type="submit" class="btn" value="Save" onclick="submitSurvey(); return false;"/>
	<span id="surveysuccess"><strong>&nbsp;&nbsp;{{ saveStatus }}</strong></span></p>
</form>
